using System;
using MoleCart.Core.Service.Catalog;
using MoleCart.Core.Data;
using MoleCart.Core.Domain.Catalog;
using System.Collections.Generic;
using MoleCart.Core.Data.Catalog;
using MoleCart.Core.Common;

namespace MoleCart.Service.Catalog
{
	public class ProductService :IProductService
	{
        IProductRepository _productRepo;
        public ProductService (IProductRepository productRepo)
		{            
            _productRepo = productRepo;
		}

        public Product GetProductById(int productId) {
            return _productRepo.GetById(productId);            
        }

        public PaginatedList<Product> GetProductList() {
            return _productRepo.GetAll(1, 10, a => a.Price > 10, x => x.Price, Core.Common.SortType.Desc);
        }

    }
}

